package com.LachesismStorm.lachesism.member.controller;

import com.LachesismStorm.lachesism.core.common.response.ResponsePage;
import com.LachesismStorm.lachesism.core.common.response.ResponseResult;
import com.LachesismStorm.lachesism.member.dto.UmsMemberParam;
import com.LachesismStorm.lachesism.member.service.UmsMemberService;
import com.LachesismStorm.lachesism.member.service.WMJService;
import com.LachesismStorm.lachesism.member.vo.CertQueryVO;
import com.LachesismStorm.lachesism.member.vo.CertVO;
import com.LachesismStorm.lachesism.member.vo.TftVO.Lineup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author lachesism
 * @Date 2024-12-29 19:37
 **/

@RestController
@Api(tags = "吴梦洁接口")
@RequestMapping("/wmj")
public class WMJController {
    @Resource
    private WMJService wmjService;

    @ApiOperation(value = "生成60的图")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "姓名"),
            @ApiImplicitParam(paramType = "query", name = "XLocation", value = "位置"),
    })
    @PostMapping("/getSixtyCert")
    public ResponseResult getSixtyCert(@RequestParam String name, @RequestParam Integer XLocation) {
        String pic = wmjService.getSixtyCert(name, XLocation);
        return ResponseResult.success(pic, "生成成功");
    }
    @PostMapping("/getESixtyCert")
    public ResponseResult getESixtyCert(@RequestBody CertVO certVO){
        String pic = wmjService.getESixtyCert(certVO);
        return ResponseResult.success(pic, "生成成功");
    }

    @PostMapping("/getESixtyCert2")
    public ResponseResult getESixtyCert2(@RequestBody CertVO certVO){
        String pic = wmjService.getESixtyCert2(certVO);
        return ResponseResult.success(pic, "生成成功");
    }

    @ApiOperation(value = "生成100的图")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "姓名"),
            @ApiImplicitParam(paramType = "query", name = "XLocation", value = "位置"),
    })
    @PostMapping("/getHundredCert")
    public ResponseResult getHundredCert(@RequestParam String name, @RequestParam Integer XLocation) {
        String pic = wmjService.getHundredCert(name, XLocation);
        return ResponseResult.success(pic, "生成成功");
    }


    @ApiOperation(value = "生成100的电子版")
    @PostMapping("/getEHundredCert")
    public ResponseResult getEHundredCert(@RequestBody CertVO certVO){
        String pic = wmjService.getEHundredCert(certVO);
        return ResponseResult.success(pic, "生成成功");
    }

    @ApiOperation(value = "生成150的实体图")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "name", value = "姓名"),
            @ApiImplicitParam(paramType = "query", name = "XLocation", value = "位置"),
    })
    @PostMapping("/getHundredFiftyCert")
    public ResponseResult getHundredFiftyCert(@RequestParam String name, @RequestParam Integer XLocation){
        String pic = wmjService.getHundredFiftyCert(name,XLocation);
        return ResponseResult.success(pic, "生成成功");
    }
    @ApiOperation(value = "生成150的图")
    @PostMapping("/getEHundredFiftyCert")
    public ResponseResult getEHundredFiftyCert(@RequestBody CertVO certVO){
        String pic = wmjService.getEHundredFiftyCert(certVO);
        return ResponseResult.success(pic, "生成成功");
    }



    @ApiOperation(value = "上传照片改尺寸")
    @PostMapping("/uploadPic")
    public ResponseResult getHundredPic(@RequestParam("file") MultipartFile file) {
        String url = wmjService.uploadPic(file);
        return ResponseResult.success(url);
    }
    @ApiOperation(value = "上传照片改尺寸")
    @PostMapping("/edit150PicSize")
    public ResponseResult edit150PicSize(@RequestParam("file") MultipartFile file) {
        String url = wmjService.edit150PicSize(file);
        return ResponseResult.success(url);
    }
    @ApiOperation(value = "上传照片改尺寸")
    @PostMapping("/edit100PicSize")
    public ResponseResult edit100PicSize(@RequestParam("file") MultipartFile file) {
        String url = wmjService.edit100PicSize(file);
        return ResponseResult.success(url);
    }


    @PostMapping("/getCookie")
    public ResponseResult getCookie(){
        String cookie = wmjService.getCookie();
        return ResponseResult.success(cookie, "查询成功");
    }

    @PostMapping("/getCaptchaImage")
    public ResponseResult getCaptchaImage(@RequestParam String cookie){
        String captchaImage = wmjService.getCaptcha(cookie);
        return ResponseResult.success(captchaImage, "查询成功");
    }

    @PostMapping("/queryCert")
    public ResponseResult queryCert(@RequestBody CertQueryVO certQueryVO){
        CertQueryVO certQuery = wmjService.queryCert(certQueryVO);
        return ResponseResult.success(certQuery, "查询成功");
    }
}
